package com.liu.config;

import com.alibaba.druid.pool.DruidDataSource;
import com.mysql.jdbc.Driver;
import org.apache.ibatis.datasource.unpooled.UnpooledDataSourceFactory;

import java.sql.SQLException;

public class myDataSource extends UnpooledDataSourceFactory {

    public myDataSource() throws SQLException {

        DruidDataSource druidDataSource = new DruidDataSource();
        druidDataSource.setUrl("jdbc:mysql://localhost:3306/demo?useEncoding=true&amp;isSSL=true&amp;characterEncoding=utf-8");
        druidDataSource.setUsername("root");
        druidDataSource.setPassword("1234");
        druidDataSource.setDriver(new Driver());
        this.dataSource = druidDataSource;
    }
}
